﻿using System;
using System.Linq.Expressions;
using Missbot.Service;
using MongoDB.Driver;

namespace Missbot.Admin.BLL.Svc
{
    public class FilterBuilder<TEntity> where TEntity : DbBaseEntity
    {
        public FilterDefinition<TEntity> Filter { get; set; }
        
        public FilterBuilder()
        {
            Filter = Builders<TEntity>.Filter.Where(p => true);
        }

        public void And(Expression<Func<TEntity, bool>> exp)
        {
            Filter &= exp;
        }
    }
}